/** prjCtrl的布点图扩展,太长的逻辑写这里 */
define(['./../../service/loadProjectMap'], function () {
    var app = angular.module('App');
    app.controller('prjCtrl.map', ['$scope', 'loadProjectMap', 'viewbag', function ($scope, loadProjectMap, viewbag) {

        /** 是否显示全局的曲线图 */
        $scope.hideChart = false;
        /** 隐藏或者打开chart */
        $scope.toggleChartOpen = function () {
            $scope.hideChart = !$scope.hideChart;
        };
        /** 如果绘制了布点图 */
        if ($scope.prj.hasJsonLayer) {
            $scope.prj.getLayer()
                .then(function () {
                    viewbag.map = loadProjectMap.loadMap('json-map');
                    $scope.jsonMapComplete = true;//完成布点图加载
                    viewbag.map.on('click', function () {
                        $scope.$apply($scope.toggleChartOpen);
                    });
                })
        }
    }]);
});